package com.song.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author 宋伟宁
 * @Date 2024/1/4
 * @Version 1.0
 **/
@RefreshScope // 自动刷新
@Slf4j
@RestController
public class ConfigConfig {

    @Value("${user.name}")
    private String userName;

//    @Value("${user.age}")
//    private Integer age;

    @GetMapping("/test")
    public String hello(){
        return "hello:"+userName;
    }

}
